import React, { Suspense } from "react";
import { Switch } from "react-router-dom";
import { Spin } from 'antd';

import { routerConfig } from "./config";

import { PermissionAuth } from "./permissionAuth";

class Routes extends React.Component {
  render() {
    return (
      <Suspense fallback={<div className='isLoading'><Spin /> &nbsp;&nbsp; 正在加载...</div>}>
        <Switch>
          <PermissionAuth config={routerConfig} />
        </Switch>
      </Suspense>
    );
  }
}

export default Routes;
